---
title: "Visor de afectaciones de la RVN"
output:
flexdashboard::flex_dashboard:
logo: 'https://raw.githubusercontent.com/ANALUGARITA/visor_afectaciones/main/image/logo.png'
orientation: rows
theme: paper
social: menu
source_code: embed
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# Carga de paquetes y de datos
library(sf)
library(DT)
library(shiny)
library(rgdal)
library(dplyr)
library(terra)
library(plotly)
library(leafem)
library(leaflet)
library(ggplot2)
library(leaflet.extras)
library(flexdashboard)
library(shinydashboard)
```
```{r datos, echo=FALSE}
# Capa de polígonos: afectaciones en proyectos
afectaciones <-
st_read(
"https://raw.githubusercontent.com/ANALUGARITA/visor_afectaciones/main/datos/CNV_afectaciones_WGS84.geojson",
quiet = TRUE
)
# Capa de puntos: inventario de proyectos
proyectos <-
st_read(
"https://raw.githubusercontent.com/ANALUGARITA/visor_afectaciones/main/datos/CNV_Proyectos_con_afectaciones_WGS84.geojson",
quiet = TRUE
)
```
Afectaciones
=======================================================================
### Afectaciones tramitadas en la Red Vial Nacional
Busqueda {.sidebar}
-------------------------------------
### Búsqueda de Afectaciones
```{r filtro, echo=FALSE}
# LISTAS PARA FILTROS
# Lista ordenada de rutas + "Todas"
lista_rutas <- unique(afectaciones$id_ruta)
lista_rutas <- sort(lista_rutas)
# Lista ordenada de afectaciones + "Todas"
lista_afectaciones <- unique(afectaciones$id_afectacion)
lista_afectaciones <- sort(lista_afectaciones)
# FILTROS
selectInput(
inputId = "id_ruta",
label = "Ruta Nacional",
choices = lista_rutas,
selected = NULL
)
selectInput(
inputId = "id_afectaciones",
label = "Identificador de afectación",
choices = lista_afectaciones,
selected = NULL
)
# LIMPIAR SELECCION
actionButton(
inputId = "NB",
label = "Nueva búsqueda"
)
nueva_busqueda <- function() {
updateSelectInput(session, "id_ruta", selected = NULL)
updateSelectInput(session, "id_afectaciones", selected = NULL)
}
observeEvent(
input$NB,
{
nueva_busqueda()
})
```
Mapa1 {.tabset}
-------------------------------------
### Mapa de Proyectos
```{r}
```
Mapa2 {.tabset}
-------------------------------------
### Ubicacion Geografica
```{r}
```
Grafico {.tabset}
-------------------------------------
### Grafico de estado de afectaciones
```{r}
```
Proyectos
=======================================================================
### Inventario de proyectos con afectaciones en la Red Vial Nacional (2016-2022)
Filtro {.sidebar}
-------------------------------------
### Filtro de Proyectos
```{r}
```
Mapa3 {.tabset}
-------------------------------------
### Mapa de Proyectos
```{r}
```
Tabla {.tabset}
-------------------------------------
### Tabla
```{r}
```